home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / beermon / init$c0.s < prev    next >
Text File  |  1980-01-03  |  1KB  |  73 lines

  1. ; this proggi loads the monifile "moni_abs" into the $c00000 area
  2. ; free ram should be there, if not you may be a la...
  3.  
  4. run:    move.l 4.w,a6
  5.     lea dosname(pc),a1
  6.     jsr -408(a6)
  7.     move.l d0,a6
  8.  
  9.     lea file0(pc),a5
  10.     bsr.w openfile
  11.     bne.s getit
  12.     lea file1(pc),a5
  13.     bsr.s openfile
  14.     bne.s getit
  15.     lea file2(pc),a5
  16.     bsr.s openfile
  17.     bne.s getit
  18.     lea file3(pc),a5
  19.     bsr.s openfile
  20.  
  21.     beq.s nofile
  22.  
  23. getit:    lea $c00000,a5
  24.     lea $c30000,a4
  25.     move.l #"beer",d1
  26.     clr.l (a5)
  27.     move.l d1,(a4)
  28.     tst.l (a5)
  29.     bne.s nofile
  30.     cmp.l (a4),d1
  31.     bne.s nofile        ;ugh, we have no 256kb ram...
  32.  
  33.     lea 4(a5),a0
  34.     moveq #-1-1,d0
  35.     moveq #0,d1
  36. clrit:    move.l d1,(a0)+        ;$3fffc bytes
  37.     dbf d0,clrit
  38.  
  39.     move.l d7,d1
  40.     move.l a5,d2
  41.     move.l #65536*4-2,d3
  42.     jsr -42(a6)    
  43.     move.l d7,d1
  44.     jsr -36(a6)
  45.  
  46.                 ;yo, all is ok
  47. quit:    move.l a6,a1
  48.     move.l 4.w,a6
  49.     jsr -414(a6)
  50.     clr.l d0
  51.     rts
  52.  
  53. nofile:    moveq #-1,d0        ;blink means you've been nasty
  54. err:    move.w $dff006,$dff180
  55.     dbf d0,err
  56.     bra.s quit
  57.  
  58. openfile:
  59.     move.l a5,d1
  60.     move.l #1005,d2
  61.     jsr -30(a6)
  62.     move.l d0,d7
  63.     rts
  64.  
  65. dosname:dc.b "dos.library",0
  66. even
  67. file0:    dc.b ":moni_abs",0
  68. file1:    dc.b "dh0:d/moni_abs",0
  69. file2:    dc.b "df0:moni_abs",0
  70. file3:    dc.b "df1:moni_abs",0
  71. oi:    dc.b "beermacht"
  72.  
  73.